package debby.bdmap.view

import android.content.Context
import android.graphics.Color
import android.view.Gravity
import android.view.View
import debby.baidumap.R
import org.jetbrains.anko.*
import org.jetbrains.anko.sdk25.coroutines.onClick

/**
 * Created by debby on 2018/6/19.
 * 描述:百度地图infoWindow
 */

//工作图标
fun getJobView(context: Context): View {
    val width = 60
    val height = 30
    return with(context) {
        verticalLayout {
            lparams(width = width, height = width)
            background = getDrawable(R.mipmap.ic_pop_up)
            //
            imageView {
                setImageDrawable(getDrawable(R.mipmap.ic_job))
            }.lparams(width = dip(width), height = dip(height))
            textView {
                text = "公司"
                padding = dip(4)
                textColor = Color.parseColor("#46a8ea")
                textSize = 16f
                gravity = Gravity.CENTER
            }.lparams(width = dip(width), height = dip(height))
            onClick {
                toast("公司")
            }
        }
    }
}